<#global staticPath = "${request.contextPath}">
<!DOCTYPE html>
<html lang="en">
	<head>
	    <meta charset="utf-8">
	    <title>管理页面</title>
	    <meta name="description" content="">
	    <meta name="author" content="banyechan">
		<meta name="viewport" content="width=device-width, initial-scale=0.5,minimum-scale=0.5, maximum-scale=2.0, user-scalable=no"/>
		
		<link href="${staticPath}/css/bootstrap/css/bootstrap.min.css" rel="stylesheet">
		<link href="${staticPath}/css/font-awesome.min.css" rel="stylesheet">
		<link href="${staticPath}/css/chosen/chosen.min.css" rel="stylesheet"/>
		<link href="${staticPath}/css/pace.css" rel="stylesheet">
		<link href="${staticPath}/css/colorbox/colorbox.css" rel="stylesheet">
		<link href="${staticPath}/css/morris.css" rel="stylesheet">
		<link href="${staticPath}/css/endless.min.css" rel="stylesheet">
		<link href="${staticPath}/css/endless-skin.css" rel="stylesheet">
		<link href="${staticPath}/css/alertify/alertify.core.css" rel="stylesheet">
		<link href="${staticPath}/css/alertify/alertify.bootstrap.css" rel="stylesheet">
		
		<link href="${staticPath}/ICalendar/css/lCalendar.css" rel="stylesheet" type="text/css"/>
		
		<style type="text/css">
			::-webkit-scrollbar{width:0px}
			
			body,html{padding: 0;margin: 0;font-size:32px;}
		</style>
		
	</head>
	<body class="overflow-hidden">
		<div id="wrapper" class="preload">
			<#-- 顶部条 -->
			<div id="top-nav" class="fixed skin-6">
				<a href="#" class="brand"> <span>天下归一</span> <span class="text-toggle">道法自然</span> </a>			
				<button type="button" class="navbar-toggle pull-left" id="sidebarToggle">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<button type="button" class="navbar-toggle pull-left hide-menu" id="menuToggle">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<ul class="nav-notification clearfix">
					<li class="dropdown">
						<a class="dropdown-toggle" data-toggle="dropdown" href="#"> <strong>${(user.userName)!}</strong> </a>
					</li>
					<li class="dropdown hidden-xs">
					</li>
					<li class="dropdown">
						<a class="dropdown-toggle logoutConfirm_open" href="#logoutConfirm">
							<strong>退出</strong>
							<span></span>
						</a>
					</li>
				</ul>
			</div>
			<#--中间部分 -->
			<div id="main-container" style="margin-left:45px;margin-right:45px">
				<div class="padding-md" >
					<#-- 中间搜索部分 -->
					<div class="row" >
						<div class="panel panel-default">
							<div class="panel-body">
								<h3 style="text-align:center;color:black; font-weight:bold;">日班计划工作台</h3>	
								<div class="panel-heading">
									<a href="#serchDiv" class="btn btn-warning btn-xs" data-toggle="modal" style="margin-top:20px;float:right" id="searchA">
										<i class="fa fa-plus fa-lg"></i> 条件搜索 
									</a>
								</div>
							</div>
						</div>
					</div>
					
					<div class="row" >
						<div class="panel panel-default table-responsive">
							<table class="table table-bordered table-condensed table-hover table-striped" id="responsiveTable">
								<thead>
									<tr>
										<th>车次名称</th>
										<th>始发站</th>
										<th>终点站</th>
										<th>到达时间</th>
										<th>发车时间</th>
										<th>接,发车股道</th>
										<th>是否上水</th>
										<th>是否去污</th>
										<th>编组</th>
										<th>车底信息</th>
										<th>担当局</th>
										<th>备注</th>
										<th>状态</th>
									</tr>
								</thead>
								<tbody>
									<#if trainList?? && trainList?size gt 0>
										<#list trainList as train>
										<tr>
											<td>${(train.trainName)!}</td>
											<td>${(train.startStationName)!}</td>
											<td>${(train.endStationName)!}</td>
											<td>
												<#if (train.reachTime)??>${train.reachTime?string('HH:mm')}</#if>
											</td>
											<td>
												<#if (train.leaveTime)??>${train.leaveTime?string('HH:mm')}</#if>
											</td>
											<td>${(train.pickUpTrack)!}股</td>
											<td>
												<#if (train.isAddWater)?? &&train.isAddWater ==1>
												<span class="label label-info">是</span>
												<#elseif (train.isAddWater)?? && train.isAddWater ==0>
													<span class="label label-default">否</span>
												</#if>
											</td>
											<td>
												<#if (train.isDealRubbish)?? &&train.isDealRubbish ==1>
												<span class="label label-info">是</span>
												<#elseif (train.isDealRubbish)?? && train.isDealRubbish ==0>
													<span class="label label-default">否</span>
												</#if>
											</td>
											<td>${(train.marshallingNumber)!}</td>
											<td>${(train.locoName)!}</td>
											<td>${(train.bearBureau)!}</td>
											<td>${(train.remark)!}</td>
											<td>
												<#if (train.state)?? &&train.state ==1>
												<span class="label label-danger">未核对</span>
												<#elseif (train.state)?? && train.state ==2>
													<span class="label label-success">已核对</span>
												</#if>
											</td>
											
										</tr>
										</#list>
									</#if>
								</tbody>
							</table>
							
						</div>
					</div>
				</div>
			</div>
		 </div>
		 
		<#-- 条件搜索form -->
		<div class="modal fade" id="serchDiv">
			<div class="modal-dialog">
				<div class="modal-content">
	  				<div class="modal-header">
	    				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						<h4>条件搜索</h4>
	  				</div>
					<div class="modal-body">
						<form class="form-horizontal form-border" id="searchForm" action="/dailyPlan/workLookList"  method="post">
							<div class="form-group">
								<label class="col-md-3 control-label text-right">车次名称</label>
								<div class="col-md-6 ">
									<input class="form-control input-sm" type="text" name="trainName" value="${(train.trainName)!}"  />
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label">始发站</label>
								<div class="col-md-4">
									<select name="startStationId" class="form-control chzn-select">
										<option value="">全部</option>
										<#if stationList?? && stationList?size gt 0>
											<#list stationList as station>
												<option value="${(station.stationId)!}"  <#if (train.startStationId)?? && train.startStationId == station.stationId>selected</#if> >${(station.stationName)!}</option>
											</#list>
										</#if>
									</select>
								</div>
								<label class="col-md-2 control-label">终点站</label>
								<div class="col-md-4">
									<select name="endStationId" class="form-control chzn-select">
										<option value="">全部</option>
										<#if stationList?? && stationList?size gt 0>
											<#list stationList as station>
												<option value="${(station.stationId)!}" <#if (train.endStationId)?? && train.endStationId == station.stationId>selected</#if>>${(station.stationName)!}</option>
											</#list>
										</#if>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label">到达时间</label>
								<div class="col-md-4">
									<div class="input-group">
										<input id="reachTime" name="reachTimeStr" class="form-control" type="text"
											value="<#if (train.reachTime)??>${train.reachTime?string('HH:mm:ss')}</#if>"/>
										<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
									</div>
								</div>
								<label class="col-md-2 control-label">发车时间</label>
								<div class="col-md-4">
									<div class="input-group">
										<input id="leaveTime" name="leaveTimeStr" class="form-control" type="text"
											value="<#if (train.leaveTime)??>${train.leaveTime?string('HH:mm:ss')}</#if>"/>
										<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label">上水</label>
								<div class="col-md-4">
									<select name="isAddWater" class="form-control chzn-select">
										<option value="">全部</option>
										<option value="0" <#if (train.isAddWater)?? && train.isAddWater == 0>selected</#if>>否</option>
										<option value="1" <#if (train.isAddWater)?? && train.isAddWater == 1>selected</#if>>是</option>
									</select>
								</div>
								<label class="col-md-2 control-label">去污</label>
								<div class="col-md-4">
									<select name="isDealRubbish" class="form-control chzn-select">
										<option value="">全部</option>
										<option value="0" <#if (train.isDealRubbish)?? && train.isDealRubbish == 0>selected</#if>>否</option>
										<option value="1" <#if (train.isDealRubbish)?? && train.isDealRubbish == 1>selected</#if>>是</option>
									</select>
								</div>
							</div>	
							<input type="hidden" name="workTrainId" id="workTrainId" value=""/>	
							<div class="form-group text-center">
								<button type="submit" class="btn btn-success"> 搜索  </button>
								<button type="button" class="btn btn-default" data-dismiss="modal"> 关闭  </button>
							</div>
						</form>	
					</div>
				</div>
			</div>
		</div>
		
		
		<#-- 退出登录  -->
		<div class="custom-popup width-100" id="logoutConfirm">
			<div class="padding-md">
				<h4 class="m-top-none">你确定要退出登录?</h4>
			</div>
			<div class="text-center">
				<a class="btn btn-success m-right-sm" href="/user/loginOut">退出</a>
				<a class="btn btn-danger logoutConfirm_close">取消</a>
			</div>
		</div>
		
		<script src="${staticPath}/js/jquery-1.10.2.min.js"></script>
		<script src="${staticPath}/js/bootstrap.min.js"></script>
		<script src='${staticPath}/js/chosen.jquery.min.js'></script>	
		<script src='${staticPath}/js/rapheal.min.js'></script>	
		<script src='${staticPath}/js/morris.min.js'></script>	
		<script src='${staticPath}/js/jquery.colorbox.min.js'></script>	
		<script src='${staticPath}/js/jquery.sparkline.min.js'></script>
		<script src='${staticPath}/js/pace.js'></script>
		<script src='${staticPath}/js/jquery.popupoverlay.min.js'></script>
		<script src='${staticPath}/js/jquery.slimscroll.min.js'></script>
		<script src='${staticPath}/js/modernizr.min.js'></script>
		<script src='${staticPath}/js/jquery.cookie.min.js'></script>
		<script src="${staticPath}/js/endless/endless.js"></script>
		<script src="${staticPath}/js/parsley.min.js"></script>
		<script src="${staticPath}/js/alertify/alertify.min.js"></script>
		<script src="${staticPath}/ICalendar/js/lCalendar.js"></script>
		<script>
			var calendartime = new lCalendar();
			calendartime.init({
				'trigger': '#reachTime',
				'type': 'time'
			});
			
			var calendartime = new lCalendar();
			calendartime.init({
				'trigger': '#leaveTime',
				'type': 'time'
			});
			
			$("#reachTime,#leaveTime").focus(function(){
        		document.activeElement.blur();
   			 });
   			 
		$(document).ready(function(){
		
			function refreshEvery5s(){
				$("#searchForm").submit();
			}
		  	
		  	var myVar =setInterval(refreshEvery5s,5000);
		  
		  	$("#searchA").click(function(){
		  		clearInterval(myVar);
		  	});
		  
		});
		
		</script>
	</body>
</html>